<template>
  <div class="modal-overlay">
    <div class="bank-selection-modal">
      <!-- 模态框头部 -->
      <div class="modal-header">
        <div class="header-content">
          <i class="fas fa-database modal-icon"></i>
          <div>
            <h3>选择题库</h3>
            <p class="subtitle">选择您需要组卷的题库资源</p>
          </div>
        </div>
        <button class="btn-close" @click="$emit('close')">
          <i class="fas fa-times"></i>
        </button>
      </div>

      <!-- 搜索和筛选区域 -->
      <div class="search-filters">
        <div class="search-container">
          <i class="fas fa-search search-icon"></i>
          <input v-model="searchQuery" type="text" placeholder="搜索题库名称、标签或知识点...">
        </div>
      </div>

      <!-- 题库列表 -->
      <div class="bank-list-container">
        <div class="list-header">
          <span class="result-count">找到 {{ filteredBanks.length }} 个题库</span>
        </div>
        
        <div class="bank-list">
          <div v-for="bank in filteredBanks" :key="bank.questionBank.bankId" class="bank-card" :class="{
            selected: localSelected.includes(bank.questionBank.bankId),
            'hover-effect': !localSelected.includes(bank.questionBank.bankId)
          }" @click="toggleBank(bank.questionBank.bankId)">
            <div class="card-content">
              <div class="bank-icon" :style="{ backgroundColor: getBankThemeColor(bank.questionBank.avgDiffculty) }">
                <i class="fas fa-book-open"></i>
              </div>
              <div class="bank-info">
                <div class="bank-header">
                  <h4>{{ bank.questionBank.bankName }}</h4>
                  <span class="difficulty-badge" :class="getDifficultyClass(bank.questionBank.avgDiffculty)">
                    {{ getDifficultyText(bank.questionBank.avgDiffculty) }}
                  </span>
                </div>
                <p class="bank-description" v-if="bank.questionBank.description">
                  {{ truncateText(bank.questionBank.description, 60) }}
                </p>
                <div class="meta-data">
                  <span class="question-count">
                    <i class="fas fa-file-alt"></i>
                    {{ bank.questionBank.totalQuestionNum }} 题
                  </span>
                  <span class="update-time">
                    <i class="fas fa-clock"></i>
                    {{ formatDate(bank.questionBank.updatedAt) }}
                  </span>
                </div>
                <div class="question-types">
                  <div class="type-badge" v-if="bank.choiceNum">
                    <i class="fas fa-dot-circle"></i>
                    <span>单选: {{ bank.choiceNum }}</span>
                  </div>
                  <div class="type-badge" v-if="bank.choicesNum">
                    <i class="fas fa-check-double"></i>
                    <span>多选: {{ bank.choicesNum }}</span>
                  </div>
                  <div class="type-badge" v-if="bank.judgementNum">
                    <i class="fas fa-balance-scale"></i>
                    <span>判断: {{ bank.judgementNum }}</span>
                  </div>
                  <div class="type-badge" v-if="bank.vacancyNum">
                    <i class="fas fa-pencil-alt"></i>
                    <span>填空: {{ bank.vacancyNum }}</span>
                  </div>
                  <div class="type-badge" v-if="bank.shortNum">
                    <i class="fas fa-comment-dots"></i>
                    <span>简答: {{ bank.shortNum }}</span>
                  </div>
                </div>
              </div>
            </div>
            <div class="selection-indicator">
              <div class="checkmark" v-if="localSelected.includes(bank.questionBank.bankId)">
                <i class="fas fa-check"></i>
              </div>
            </div>
            <div class="selection-overlay" v-if="localSelected.includes(bank.questionBank.bankId)"></div>
          </div>
        </div>

        <div class="empty-state" v-if="filteredBanks.length === 0">
          <i class="fas fa-search-empty"></i>
          <p>没有找到匹配的题库</p>
          <button class="btn-reset" @click="resetFilters">重置筛选条件</button>
        </div>
      </div>

      <!-- 模态框底部 -->
      <div class="modal-footer">
        <div class="selection-summary">
          <div class="summary-info-row">
            <div class="selected-info">
              <i class="fas fa-check-circle"></i>
              <span>已选 <strong>{{ localSelected.length }}</strong> 个题库</span>
            </div>
            <div class="question-type-stats" v-if="localSelected.length > 0">
              <div class="type-badge" v-if="getTotalChoiceNum() > 0">
                <i class="fas fa-dot-circle"></i>
                <span>单选: {{ getTotalChoiceNum() }}</span>
              </div>
              <div class="type-badge" v-if="getTotalChoicesNum() > 0">
                <i class="fas fa-check-double"></i>
                <span>多选: {{ getTotalChoicesNum() }}</span>
              </div>
              <div class="type-badge" v-if="getTotalJudgementNum() > 0">
                <i class="fas fa-balance-scale"></i>
                <span>判断: {{ getTotalJudgementNum() }}</span>
              </div>
              <div class="type-badge" v-if="getTotalVacancyNum() > 0">
                <i class="fas fa-pencil-alt"></i>
                <span>填空: {{ getTotalVacancyNum() }}</span>
              </div>
              <div class="type-badge" v-if="getTotalShortNum() > 0">
                <i class="fas fa-comment-dots"></i>
                <span>简答: {{ getTotalShortNum() }}</span>
              </div>
            </div>
            <div class="total-questions">
              共计 {{ getTotalQuestions() }} 题
            </div>
          </div>
        </div>
        <div class="modal-actions">
          <button class="btn-cancel" @click="$emit('close')">
            <i class="fas fa-times"></i>
            取消
          </button>
          <button class="btn-confirm" @click="confirmSelection">
            <i class="fas fa-check"></i>
            确认选择
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    questionBanks: {
      type: Array,
      default: () => []
    },
    selectedBanks: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      searchQuery: '',
      activeTags: [],
      localSelected: [...this.selectedBanks],
      sortOption: 'recent',
      tagColors: {
        'Java': '#E76F51',
        '数据库': '#2A9D8F',
        '网络': '#264653',
        '算法': '#E9C46A',
        '前端': '#F4A261',
        '后端': '#3A86FF',
        '安全': '#8338EC',
        '基础': '#06D6A0',
        '高级': '#EF476F'
      },
      iconMap: {
        'Java': 'fab fa-java',
        '数据库': 'fas fa-database',
        '网络': 'fas fa-network-wired',
        '算法': 'fas fa-project-diagram',
        '前端': 'fab fa-js',
        '后端': 'fas fa-server',
        '安全': 'fas fa-shield-alt',
        '基础': 'fas fa-book',
        '高级': 'fas fa-graduation-cap'
      }
    }
  },
  created() {
    // console.log("传入的题库：", this.questionBanks);

  },
  computed: {
    allTags() {
      const tags = new Set()
      this.questionBanks.forEach(bank => {
        bank.tags.forEach(tag => tags.add(tag))
      })
      return Array.from(tags)
    },
    filteredBanks() {
      let banks = this.questionBanks

      // 搜索过滤
      if (this.searchQuery) {
        const query = this.searchQuery.toLowerCase()
        banks = banks.filter(bank => {
          // || bank.tags.some(tag => tag.toLowerCase().includes(query))
          return bank.questionBank.bankName.toLowerCase().includes(query);
        })
      }
      // 排序
      switch (this.sortOption) {
        case 'name':
          return banks.sort((a, b) => a.bankName.localeCompare(b.bankName))
        case 'count':
          return banks.sort((a, b) => b.totalQuestionNum - a.totalQuestionNum)
        case 'recent':
          return banks.sort(() => Math.random() - 0.5) // 模拟最近使用排序
        default:
          return banks
      }
    }
  },
  methods: {
    getTagCount(tag) {
      // return this.questionBanks.filter(bank =>
      //   bank.tags.includes(tag)
      // ).length
    },
    getBankColor(id) {
      const colors = ['#4361EE', '#3A0CA3', '#7209B7', '#F72585', '#4CC9F0']
      return colors[id % colors.length]
    },
    getTagColor(tag) {
      return this.tagColors[tag] || '#6C757D'
    },
    getBankIcon(tag) {
      return this.iconMap[tag] || 'fas fa-book'
    },
    getRandomDate() {
      const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
      const month = months[Math.floor(Math.random() * 12)]
      const day = Math.floor(Math.random() * 28) + 1
      return `${month}${day}日`
    },
    getTotalQuestions() {
      return this.questionBanks
        .filter(bank => this.localSelected.includes(bank.questionBank.bankId))
        .reduce((sum, bank) => sum + bank.questionBank.totalQuestionNum, 0)
    },
    getTotalChoiceNum() {
      return this.questionBanks
        .filter(bank => this.localSelected.includes(bank.questionBank.bankId))
        .reduce((sum, bank) => sum + (bank.choiceNum || 0), 0)
    },
    getTotalChoicesNum() {
      return this.questionBanks
        .filter(bank => this.localSelected.includes(bank.questionBank.bankId))
        .reduce((sum, bank) => sum + (bank.choicesNum || 0), 0)
    },
    getTotalJudgementNum() {
      return this.questionBanks
        .filter(bank => this.localSelected.includes(bank.questionBank.bankId))
        .reduce((sum, bank) => sum + (bank.judgementNum || 0), 0)
    },
    getTotalVacancyNum() {
      return this.questionBanks
        .filter(bank => this.localSelected.includes(bank.questionBank.bankId))
        .reduce((sum, bank) => sum + (bank.vacancyNum || 0), 0)
    },
    getTotalShortNum() {
      return this.questionBanks
        .filter(bank => this.localSelected.includes(bank.questionBank.bankId))
        .reduce((sum, bank) => sum + (bank.shortNum || 0), 0)
    },
    toggleBank(bankId) {
      if (this.localSelected.includes(bankId)) {
        this.localSelected = this.localSelected.filter(id => id !== bankId)
      } else {
        this.localSelected.push(bankId)
      }
    },
    resetFilters() {
      this.searchQuery = ''
      this.activeTags = []
      this.sortOption = 'recent'
    },
    confirmSelection() {
      this.$emit('update-selection', this.localSelected)
    },
    getBankThemeColor(difficulty) {
      if (!difficulty) return '#4361EE';
      if (difficulty >= 1 && difficulty <= 4) return '#10B981'; // 简单 - 绿色
      if (difficulty >= 5 && difficulty <= 7) return '#F59E0B'; // 中等 - 橙色
      if (difficulty >= 8 && difficulty <= 10) return '#EF4444'; // 困难 - 红色
      return '#4361EE'; // 未知难度 - 蓝色
    },
    getDifficultyClass(difficulty) {
      if (!difficulty) return 'difficulty-unknown';
      if (difficulty >= 1 && difficulty <= 4) return 'difficulty-easy';
      if (difficulty >= 5 && difficulty <= 7) return 'difficulty-medium';
      if (difficulty >= 8 && difficulty <= 10) return 'difficulty-hard';
      return 'difficulty-unknown';
    },
    getDifficultyText(difficulty) {
      if (!difficulty) return '未知难度';
      if (difficulty >= 1 && difficulty <= 4) return '简单';
      if (difficulty >= 5 && difficulty <= 7) return '中等';
      if (difficulty >= 8 && difficulty <= 10) return '困难';
      return '未知难度';
    },
    truncateText(text, maxLength) {
      if (!text) return '';
      if (text.length > maxLength) {
        return text.slice(0, maxLength) + '...';
      }
      return text;
    },
    formatDate(dateString) {
      if (!dateString) return '未知时间';
      try {
        const date = new Date(dateString);
        // 格式化为 yyyy-MM-dd HH:mm:ss
        return date.getFullYear() + '-' +
               (date.getMonth() + 1).toString().padStart(2, '0') + '-' +
               date.getDate().toString().padStart(2, '0') + ' ' +
               date.getHours().toString().padStart(2, '0') + ':' +
               date.getMinutes().toString().padStart(2, '0') + ':' +
               date.getSeconds().toString().padStart(2, '0');
      } catch (e) {
        console.error('日期格式化错误:', e);
        return dateString;
      }
    }
  }
}
</script>

<style scoped lang="scss">
@import "@/styles/variables.scss";

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.bank-selection-modal {
  width: 900px;
  max-width: 95%;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #4361EE, #3A0CA3);
  color: white;

  .header-content {
    display: flex;
    align-items: center;
    gap: 1rem;

    .modal-icon {
      font-size: 1.8rem;
      color: rgba(255, 255, 255, 0.9);
    }

    h3 {
      margin: 0;
      font-size: 1.5rem;
      font-weight: 600;
    }

    .subtitle {
      margin: 0.25rem 0 0;
      font-size: 0.875rem;
      opacity: 0.9;
    }
  }

  .btn-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: rotate(90deg);
    }
  }
}

.search-filters {
  padding: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  background: #F8F9FA;
}

.search-container {
  position: relative;
  margin-bottom: 1rem;

  input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;

    &:focus {
      outline: none;
      box-shadow: 0 2px 12px rgba(67, 97, 238, 0.2);
    }

    &::placeholder {
      color: #ADB5BD;
    }
  }

  .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6C757D;
    font-size: 1rem;
  }

  .btn-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4361EE;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      background: #3A0CA3;
      transform: translateY(-50%) scale(1.1);
    }

    i {
      font-size: 0.8rem;
    }
  }
}

.filter-section {
  .filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 0.75rem;

    i {
      color: #4361EE;
    }
  }

  .tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  button {
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    border: none;
    background: #E9ECEF;
    color: #495057;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;

    &:hover {
      background: #DEE2E6;
    }

    &.active {
      background: #4361EE;
      color: white;
      box-shadow: 0 2px 6px rgba(67, 97, 238, 0.3);

      .tag-count {
        background: rgba(255, 255, 255, 0.2);
      }
    }

    .tag-count {
      font-size: 0.6875rem;
      background: rgba(0, 0, 0, 0.05);
      padding: 0.125rem 0.375rem;
      border-radius: 10px;
      margin-left: 0.25rem;
    }
  }
}

.bank-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.5rem;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #F1F3F5;
  margin-bottom: 0.5rem;

  .result-count {
    font-size: 0.875rem;
    color: #6C757D;
  }

  .sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6C757D;

    select {
      padding: 0.375rem 0.75rem;
      border-radius: 6px;
      border: 1px solid #DEE2E6;
      font-size: 0.8125rem;
      cursor: pointer;

      &:focus {
        outline: none;
        border-color: #4361EE;
      }
    }
  }
}

.bank-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0;
}

.bank-card {
  position: relative;
  background: white;
  border-radius: 12px;
  border: 1px solid #E9ECEF;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;

  &.hover-effect:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #4361EE;
  }

  &.selected {
    border-color: #4361EE;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    transform: scale(0.98);

    .selection-indicator {
      opacity: 1;
      transform: scale(1);
    }

    .selection-overlay {
      opacity: 0.08;
    }

    &:hover {
      transform: scale(0.98) translateY(-3px);
    }
  }

  .selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #4361EE;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .selection-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #4361EE transparent transparent;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(0.8);

    .checkmark {
      position: absolute;
      top: 4px;
      right: -36px;
      color: white;
      font-size: 0.8rem;
      animation: checkmarkPop 0.4s ease;
    }
  }

  .card-content {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    position: relative;
    z-index: 1;
  }

  .bank-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  }

  .bank-info {
    flex: 1;

    .bank-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.5rem;
      
      h4 {
        margin: 0;
        font-size: 1rem;
        color: #212529;
        font-weight: 600;
        line-height: 1.3;
        flex: 1;
      }
      
      .difficulty-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 20px;
        color: white;
        font-weight: 600;
        
        &.difficulty-easy {
          background-color: #10B981;
        }
        
        &.difficulty-medium {
          background-color: #F59E0B;
        }
        
        &.difficulty-hard {
          background-color: #EF4444;
        }
        
        &.difficulty-unknown {
          background-color: #6C757D;
        }
      }
    }
    
    .bank-description {
      margin: 0 0 0.75rem;
      font-size: 0.8125rem;
      color: #6C757D;
      line-height: 1.4;
    }

    .meta-data {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      margin-bottom: 0.75rem;

      span {
        font-size: 0.8125rem;
        color: #6C757D;
        display: flex;
        align-items: center;
        gap: 0.25rem;

        i {
          font-size: 0.8rem;
          color: #ADB5BD;
        }
      }
    }
    
    .question-types {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.75rem;
      
      .type-badge {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
        background-color: #F8F9FA;
        border-radius: 6px;
        font-size: 0.75rem;
        color: #495057;
        transition: all 0.2s ease;
        
        &:hover {
          background-color: #E9ECEF;
        }
        
        i {
          color: #4361EE;
        }
      }
    }
  }
}

.empty-state {
  padding: 3rem 0;
  text-align: center;

  i {
    font-size: 3rem;
    color: #E9ECEF;
    margin-bottom: 1rem;
  }

  p {
    color: #6C757D;
    margin-bottom: 1.5rem;
  }

  .btn-reset {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    background: #4361EE;
    border: none;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      background: #3A0CA3;
    }
  }
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #F1F3F5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #F8F9FA;

  .selection-summary {
    margin-bottom: 1rem;
    
    .summary-info-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.75rem;
    }

    .selected-info {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.9375rem;
      white-space: nowrap;

      i {
        color: #4361EE;
        font-size: 1.2rem;
      }

      strong {
        color: #4361EE;
      }
    }

    .question-type-stats {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem;
      flex: 1;
      
      .type-badge {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.75rem;
        background-color: #F8F9FA;
        border: 1px solid #E9ECEF;
        border-radius: 20px;
        font-size: 0.75rem;
        color: #495057;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        transition: all 0.2s ease;
        white-space: nowrap;
        
        &:hover {
          background-color: #E9ECEF;
          transform: translateY(-1px);
        }
        
        i {
          color: #4361EE;
          font-size: 0.875rem;
        }
      }
    }

    .total-questions {
      font-size: 0.8125rem;
      color: #4361EE;
      font-weight: 500;
      padding: 0.25rem 0.75rem;
      border: 1px solid #E0E7FF;
      background-color: #EEF2FF;
      border-radius: 20px;
      white-space: nowrap;
    }
  }

  .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;

    button {
      padding: 0.625rem 1.25rem;
      border-radius: 8px;
      font-size: 0.875rem;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 0.5rem;

      i {
        font-size: 0.8rem;
      }
    }

    .btn-cancel {
      background: white;
      border: 1px solid #DEE2E6;
      color: #6C757D;

      &:hover {
        background: #F1F3F5;
      }
    }

    .btn-confirm {
      background: #4361EE;
      border: none;
      color: white;
      box-shadow: 0 2px 6px rgba(67, 97, 238, 0.3);

      &:hover {
        background: #3A0CA3;
      }
    }
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .bank-selection-modal {
    width: 95%;
    max-height: 85vh;
  }

  .bank-list {
    grid-template-columns: 1fr;
  }

  .modal-header {
    padding: 1rem;

    .header-content {
      gap: 0.75rem;

      h3 {
        font-size: 1.25rem;
      }
    }
  }

  .search-filters {
    padding: 1rem;
  }

  .modal-footer {
    padding: 1rem;
    
    .selection-summary {
      .summary-info-row {
        gap: 0.5rem;
      }
      
      .question-type-stats {
        order: 2;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-start;
      }
      
      .total-questions {
        margin-left: auto;
      }
    }

    .modal-actions {
      justify-content: flex-end;
      margin-top: 1rem;
    }
  }
}
</style>